package tech.aistar.day01.HomeWork;

public class Computer {
    //品牌
    private String branch;
    //价格
    private double price;
    //描述
    private String describe;
    //显示器
    private Screen screen;
    //构造方法
    public Computer(String branch,double price,String describe,Screen screen){
        this.branch=branch;
        this.price=price;
        this.describe=describe;
        this.screen=screen;
    }
    public Computer(){

    }

    public double getPrice() {
        return price;
    }

    public Screen getScreen() {
        return screen;
    }

    public String getBranch() {
        return branch;
    }

    public String getDescribe() {
        return describe;
    }


    public void setBranch(String branch) {
        this.branch = branch;
    }

    public void setPrice(double price) {
        if(price<1000||price>20000){
            this.price=2000;
        }else {
            this.price = price;
        }
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public void setScreen(Screen screen) {
        this.screen = screen;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("tech.aistar.day01.HomeWork.Computer{");
        sb.append("branch='").append(branch).append('\'');
        sb.append(", price=").append(price);
        sb.append(", describe='").append(describe).append('\'');
        sb.append(", screen=").append(screen);
        sb.append('}');
        return sb.toString();
    }
}